package com.bohua.Car.admin.controller;


import com.bohua.Car.admin.common.Lay;
import com.bohua.Car.admin.common.Msg;
import com.bohua.Car.admin.entity.Users;
import com.bohua.Car.admin.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/User")
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping
    public String user(){return "User/User.html"; };

    @RequestMapping("/getCars")
    @ResponseBody
    public Lay getUser(Users users, Integer page, Integer limit){
        return userService.getUser(users,page,limit);
    }

    @RequestMapping("/login")
    @ResponseBody
    public Msg login(Users users){
        return userService.login(users);
    }

}
